<%
// for some other jsp including
%>
<%!
HttpServletRequest req;
/**
 * avoid null value to show
 */
public String nn(Object obj){
	return utils.HtmlUtil.noNull(obj);
}

/**
 * getNameById
 */
public String nm(String col,String tab,String id,String v){
	return utils.BussUtil.getNameById(col,tab,id,v);
}

/**
 * get String value acorse expression like "customer.name"
 */
public String $(String exp){
	int pid=exp.indexOf(".");
	if(pid==-1)return nn(req.getAttribute(exp));
	Object obj=req.getAttribute(exp.substring(0,pid));
	if(obj==null)return "";
	exp=exp.substring(pid+1);
	return nn(utils.BussUtil.$(obj,exp));
} 

/**
 * get attribute from page
 */
public String gain(String attr){
	String rst=(String)req.getAttribute(attr);
	if(rst==null||rst.length()<1)
		rst=req.getParameter(attr);
	return rst;
}

/**
 * judge whether this is administrator
 */
public boolean isAdmin(){
	if("admin".equals(req.getSession().getAttribute("userName")))
		return true;
	else
		return false;
} 
%>
<%
req=request;
%>